; Music of Mata Hari (1988) (Loriciels) (JP Biscay)
; Ripped by Megachur the 27/03/2008

	write "MATAHARI.BIN"

music_date_rip	equ &1b38
music_adr	equ &82b3
first_theme	equ 0
last_theme	equ 0

	read "music_header_v1_0.asm"

.l82b3
	jp #bd34
.l82b6
	jp #bca7
.l82b9
	jp #bcaa
;82bc
;
;.init_music_interrupt
;
	call l82b6
	ld a,#c9
	call l82d0
	jp l86c0
	call l86c3
	ld a,#c3
	call l82d0
	ret
.l82d0
	ld (l82b3),a
	ld (l82b6),a
	ld (l82b9),a
	ret
	db #00,#00,#00,#00,#00,#00,#00,#00
	db #00,#00,#00,#00,#00,#00,#00,#00
	db #00,#00,#00,#00,#00,#00,#00,#00
	db #00,#00,#00,#00,#00,#00,#00,#00
	db #00,#00,#00,#00,#00,#00,#00,#00
	db #00,#00,#00,#00,#00,#00,#00,#00
	db #00,#00,#00,#00,#00,#00,#00,#00
	db #00,#00,#00,#00,#00,#00,#00,#00
	db #00,#00,#00,#00,#00,#00,#00,#00
	db #00,#00,#00,#00,#00,#00,#00,#00
	db #00,#00,#00,#00,#00,#00,#00,#00
	db #00,#00,#00,#00,#00,#00,#00,#00
	db #00,#00,#00,#00,#00,#00,#00,#00
	db #00,#00,#00,#00,#00,#00,#00,#00
	db #00,#00,#00,#00,#00,#00,#00,#00
	db #00,#00,#00,#00,#00,#00,#00,#00
	db #00,#00,#00,#00,#00,#00,#00,#00
	db #00,#00,#00,#00,#00,#00,#00,#00
	db #00,#00,#00,#00,#00,#00,#00,#00
	db #00,#00,#00,#00,#00,#00,#00,#00
	db #00,#00,#00,#00,#00,#00,#00,#00
	db #00,#00,#00,#00,#00,#00,#00,#00
	db #00,#00,#00,#00,#00,#00,#00,#00
	db #00,#00,#00,#00,#00,#00,#00,#00
	db #00,#00,#00,#00,#00,#00,#00,#00
	db #00,#00,#00,#00,#00,#00,#00,#00
	db #00,#00,#00,#00,#00,#00,#00,#00
	db #00,#00,#00,#00,#00,#00,#00,#00
	db #00,#00,#00,#00,#00,#00,#00,#00
	db #00,#00,#00,#00,#00,#00,#00,#00
	db #00,#00,#00,#00,#00,#00,#00,#00
	db #00,#00,#00,#00,#00,#00,#00,#00
	db #00,#00,#00,#00,#00,#00,#00,#00
	db #00,#00,#00,#00,#00,#00,#00,#00
	db #00,#00,#00,#00,#00,#00,#00,#00
	db #00,#00,#00,#00,#00,#00,#00,#00
	db #00,#00,#00,#00,#00,#00,#00,#00
	db #00,#00,#00,#00,#00,#00,#00,#00
	db #00,#00,#00,#00,#00,#00,#00,#00
	db #00,#00,#00,#00,#00,#00,#00,#00
	db #00,#00,#00,#00,#00,#00,#00,#00
	db #00,#00,#00,#00,#00,#00,#00,#00
	db #00,#00,#00,#00,#00,#00,#00,#00
	db #00,#00,#00,#00,#00,#00,#00,#00
	db #00,#00,#00,#00,#00,#00,#00,#00
	db #00,#00,#00,#00,#00,#00,#00,#00
	db #00,#00,#00,#00,#00,#00,#00,#00
	db #00,#00,#00,#00,#00,#00,#00,#00
	db #00,#00,#00,#00,#00,#00,#00,#00
	db #00,#00,#00,#00,#00,#00,#00,#00
	db #00,#00,#00,#00,#00,#00,#00,#00
	db #00,#00,#00,#00,#00,#00,#00,#00
	db #00,#00,#00,#00,#00,#00,#00,#00
	db #00,#00,#00,#00,#00,#00,#00,#00
	db #00,#00,#00,#00,#00,#00,#00,#00
	db #00,#00,#00,#00,#00,#00,#00,#00
	db #00,#00,#00,#00,#00,#00,#00,#00
	db #00,#00,#00,#00,#00,#00,#00,#00
	db #00,#00,#00,#00,#00,#00,#00,#00
	db #00,#00,#00,#00,#00,#00,#00,#00
	db #00,#00,#00,#00,#00,#00,#00,#00
	db #00,#00,#00,#00,#00,#00,#00,#00
	db #00,#00,#00,#00,#00,#00,#00,#00
	db #00,#00,#00,#00,#00,#00,#00,#00
	db #00,#00,#00,#00,#00,#00,#00,#00
	db #00,#00,#00,#00,#00,#00,#00,#00
	db #00,#00,#00,#00,#00,#00,#00,#00
	db #00,#00,#00,#00,#00,#00,#00,#00
	db #00,#00,#00,#00,#00,#00,#00,#00
	db #00,#00,#00,#00,#00,#00,#00,#00
	db #00,#00,#00,#00,#00,#00,#00,#00
	db #00,#00,#00,#00,#00,#00,#00,#00
	db #00,#00,#00,#00,#00,#00,#00,#00
	db #00,#00,#00,#00,#00,#00,#00,#00
	db #00,#00,#00,#00,#00,#00,#00,#00
	db #00,#00,#00,#00,#00,#00,#00,#00
	db #00,#00,#00,#00,#00,#00,#00,#00
	db #00,#00,#00,#00,#00,#00,#00,#00
	db #00,#00,#00,#00,#00,#00,#00,#00
	db #00,#00,#00,#00,#00,#00,#00,#00
	db #00,#00,#00,#00,#00,#00,#00,#00
	db #00,#00,#00,#00,#00,#00,#00,#00
	db #00,#00,#00,#00,#00,#00,#00,#00
	db #00,#00,#00,#00,#00,#00,#00,#00
	db #00,#00,#00,#00,#00,#00,#00,#00
	db #00,#00,#00,#00,#00,#00,#00,#00
	db #00,#00,#00,#00,#00,#00,#00,#00
	db #00,#00,#00,#00,#00,#00,#00,#00
	db #00,#00,#00,#00,#00,#00,#00,#00
	db #00,#00,#00,#00,#00,#00,#00,#00
	db #00,#00,#00,#00,#00,#00,#00,#00
	db #00,#00,#00,#00,#00,#00,#00,#00
	db #00,#00,#00,#00,#00,#00,#00,#00
	db #00,#00,#00,#00,#00,#00,#00,#00
	db #00,#00,#00,#00,#00,#00,#00,#00
	db #00,#00,#00,#00,#00,#00,#00,#00
	db #00,#00,#00,#00,#00,#00,#00,#00
	db #00,#00,#00,#00,#00,#00,#00,#00
	db #00,#00,#00,#00,#00,#00,#00,#00
	db #00,#00,#00,#00,#00,#00,#00,#00
	db #00,#00,#00,#00,#00,#00
.l8600
	dw #0eee,#0e18,#0d4d,#0c8e
	dw #0bda,#0b2f,#0a8f,#09f7
	dw #0968,#08e1,#0861,#07e9
	dw #0777,#070c,#06a7,#0647
	dw #05ed,#0598,#0547,#04fc
	dw #04b4,#0470,#0431,#03f4
	dw #03bc,#0386,#0353,#0324
	dw #02f6,#02cc,#02a4,#027e
	dw #025a,#0238,#0218,#01fa
	dw #01de,#01c3,#01aa,#0192
	dw #017b,#0166,#0152,#013f
	dw #012d,#011c,#010c,#00fd
	dw #00ef,#00e1,#00d5,#00c9
	dw #00be,#00b3,#00a9,#009f
	dw #0096,#008e,#0086,#007f
	dw #0077,#0071,#006a,#0064
	dw #005f,#0059,#0054,#0050
	dw #004b,#0047,#0043,#003f
	dw #003c,#0038,#0035,#0032
	dw #002f,#002d,#002a,#0028
	dw #0026,#0024,#0022,#0020
	dw #001e,#001c,#001b,#0019
	dw #0018,#0016,#0015,#0014
	dw #0013,#0012,#0011,#0010
.l86c0
	jp l8819
.l86c3
	jp l8826
.l86c6
	db #01,#01,#00
	dw l889c,l889c,l889c,l889c
	dw l889c,l889c,l889c,l88a9
	dw #0000
.l86db
	db #01,#01,#00
	dw l8899,l88b4,l88b4,l88c7
	dw l88b4,l88ee,l88da,l8901
	dw l8899,l88b4,l88b4,l88c7
	dw l88b4,l88ee,l88da,l8901
	dw #0000
.l8700
	db #01,#01,#00
	dw l8899,l88b4,l8912,l8923
	dw l88b4,l8934,l88da,l8945
	dw l8899,l8912,l8912,l8923
	dw l8912,l8934,l8923,l8945
	dw #0000
.l8729 equ $ + 4
.l8728 equ $ + 3
.l8727 equ $ + 2
.l8725
	db #00,#00,#00,#00,#01,#0b,#0b,#00
.l8732 equ $ + 5
.l8730 equ $ + 3
.l872e equ $ + 1
	db #00,#00,#00,#00,#00,#02,#0c,#0c
.l873b equ $ + 6
	db #00,#00,#00,#04,#00,#00,#04,#0d
	db #0d,#00,#00,#00,#04,#00,#00
.l8744
	ld iy,l86db
	ld a,#02
.l874a
	ld (l8728),a
	dec (iy+#00)
	ret nz
.l8751
	push iy
	pop hl
	inc hl
	ld a,(iy+#01)
	add a
	ld c,a
	ld b,#00
	add hl,bc
	ld e,(hl)
	inc hl
	ld d,(hl)
	ld a,d
	or a
	jr nz,l876e
	ld (iy+#01),#01
.l8768
	ld (iy+#02),#00
	jr l8751
.l876e
	ex de,hl
	ld c,(iy+#02)
	ld b,#00
	add hl,bc
	push hl
	pop ix
	ld a,(ix+#00)
.l877c equ $ + 1
	call l87de
	ld a,(ix+#01)
	ld (iy+#00),a
	ld b,a
	add b
	ld (l8727),a
	ld a,(ix+#00)
	or a
	jr nz,l8794
.l878f
	inc (iy+#01)
	jr l8768
.l8794
	ld a,(l8728)
	cp #01
	jr nz,l87a0
	ld hl,l8729
	jr l87ac
.l87a0
	cp #02
	jr nz,l87a9
	ld hl,l8732
	jr l87ac
.l87a9
	ld hl,l873b
.l87ac
	nop
	push hl
	inc hl
	inc hl
	inc hl
	ld de,(l8725)
	ld (hl),e
	inc hl
	ld (hl),d
	inc hl
	inc hl
	inc hl
	ld a,(l8727)
	ld (hl),a
	pop hl
.l87c0
	push ix
	push iy
	call #bcaa
	pop iy
	pop ix
	inc (iy+#02)
	inc (iy+#02)
	ld a,(ix+#02)
	or a
	ret nz
	inc (iy+#01)
	ld (iy+#02),#00
	ret
.l87de
	ld hl,l8600
	add a
	ld c,a
	ld b,#00
	add hl,bc
	ld e,(hl)
	inc hl
	ld d,(hl)
	ld (l8725),de
	ret
.l87ee
	ld (l872e),a
	ld a,(ix+#01)
	ld (iy+#00),a
	ld (l8730),a
	ld a,(ix+#00)
	or a
	jr z,l8807
	ld hl,l8729
	pop af
	jp l87c0
.l8807
	pop af
	jp l878f
.l880b
	db #00,#00,#f1,#00,#00,#81
	dw l887d
	db #00,#00,#00,#00,#00,#00
.l8819
	ld hl,l880b
	ld b,#81
	ld c,#00
	ld de,l887d
	jp #bce0
.l8826
	ld hl,l880b
	call #bce6
	ld iy,l86db
	ld (iy+#00),#01
	ld (iy+#01),#01
	ld (iy+#02),#00
	ld iy,l8700
	ld (iy+#00),#01
	ld (iy+#01),#01
	ld (iy+#02),#00
	ld iy,l86c6
	ld (iy+#00),#01
	ld (iy+#01),#01
	ld (iy+#02),#00
	ret
.l885d
	ld hl,l87ee
	ld (l877c),hl
	ld a,#01
	ld iy,l86c6
	call l874a
	ld hl,l87de
	ld (l877c),hl
	ret
.l8873
	ld a,#04
	ld iy,l8700
	jp l874a
.l887c
	db #01
;
.play_music
.l887d	; play
;
	ld hl,l887c
	dec (hl)
	ret nz
	ld a,(l8898)
	ld (hl),a
	push ix
	push iy
	call l8744
	call l8873
	call l885d
	pop iy
	pop ix
	ret
.l889c equ $ + 4
.l8899 equ $ + 1
.l8898
	db #06,#28,#80,#00,#14,#10,#01,#0c
	db #14,#04,#14,#10,#02,#0c,#02,#04
.l88a9 equ $ + 1
	db #00,#01,#0c,#01,#10,#01,#10,#01
.l88b4 equ $ + 4
	db #10,#01,#04,#00,#28,#10,#34,#10
	db #32,#08,#2f,#10,#2b,#12,#2b,#06
.l88c7 equ $ + 7
	db #2d,#10,#2d,#10,#2d,#10,#00,#2d
	db #10,#39,#10,#37,#08,#34,#10,#30
	db #12,#30,#06,#32,#10,#32,#10,#32
.l88da equ $ + 2
	db #10,#00,#2d,#10,#39,#10,#37,#08
	db #34,#10,#39,#12,#34,#06,#34,#10
.l88ee equ $ + 6
	db #37,#10,#39,#10,#00,#00,#2f,#10
	db #3b,#10,#39,#08,#36,#10,#3b,#12
	db #36,#06,#36,#10,#39,#10,#3b,#10
.l8901 equ $ + 1
	db #00,#28,#10,#26,#10,#25,#10,#24
	db #10,#23,#0c,#21,#04,#22,#0c,#23
.l8912 equ $ + 2
	db #24,#00,#40,#10,#40,#10,#43,#08
	db #40,#10,#40,#18,#3e,#10,#3e,#10
.l8923 equ $ + 3
	db #3e,#10,#00,#45,#10,#45,#10,#48
	db #08,#45,#10,#45,#18,#43,#10,#43
.l8934 equ $ + 4
	db #10,#43,#10,#00,#47,#10,#47,#10
	db #4a,#08,#47,#10,#47,#18,#45,#10
.l8945 equ $ + 5
	db #45,#10,#45,#10,#00,#40,#10,#44
	db #10,#45,#10,#46,#10,#47,#0c,#45
	db #04,#46,#0c,#47,#24,#00,#0c,#47
	db #24,#00,#00,#00,#00,#00,#00,#00
	db #00,#00,#00,#00,#00,#00,#00,#00
	db #00,#00,#00,#00,#00,#00,#00,#00
	db #00,#00,#00,#00,#00,#00,#00,#00
	db #00,#00,#00,#00,#00,#00,#00,#00
	db #00,#00,#00,#00,#00,#00,#00,#00
	db #00,#00,#00,#00,#00,#00,#00,#00
	db #00,#00,#00,#00,#00,#00,#00,#00
	db #00,#00,#00,#00,#00,#00,#00,#00
	db #00,#00,#00,#00,#00,#00,#00,#00
	db #00,#00,#00,#00,#00,#00,#00,#00
	db #00,#00,#00,#00,#00,#00,#00,#00
	db #00,#00,#00,#00,#00,#00,#00,#00
	db #00,#00,#00,#00,#00,#00,#00,#00
	db #00,#00,#00,#00,#00,#00,#00,#00
	db #00,#00,#00,#00,#00,#00,#00,#00
	db #00,#00,#00,#00,#00,#00,#00,#00
	db #00,#00,#00,#00,#00,#00,#00,#00
	db #00,#00,#00,#00,#00,#00,#00,#00
	db #00,#00,#00,#00,#00,#00,#00,#00
	db #00,#00,#00,#00,#00,#15,#14,#21

.l663a
	db #02,#01,#0f,#01,#0d,#ff,#02,#00
.l6647 equ $ + 5
.l6642
	db #01,#08,#1e,#01,#00,#02,#01,#0b
.l6650 equ $ + 6
	db #08,#06,#fe,#05,#00,#00,#02,#01
.l6658 equ $ + 6
	db #08,#05,#0b,#01,#03,#00,#02,#02
.l6660 equ $ + 6
	db #0a,#01,#01,#ec,#01,#00,#02,#01
.l6668 equ $ + 6
	db #02,#02,#07,#fe,#06,#00,#01,#05
.l666d equ $ + 3
	db #01,#04,#00,#01,#0d,#fd,#02,#00
.l6672
	db #02,#00,#01,#02,#08,#fe,#03,#00
.l6680 equ $ + 6
.l667a
	db #01,#0d,#03,#02,#00,#00,#05,#01
	db #00,#0a,#01,#03,#0a,#01,#fd,#0a
.l6691 equ $ + 7
	db #01,#fd,#0a,#01,#06,#0a,#00,#05
	db #01,#00,#0a,#01,#e2,#0a,#01,#0f
	db #0a,#01,#f8,#0a,#01,#04,#0a,#00
	db #00,#00,#00,#00,#00,#00,#00,#00
;
.init_music
;
	ld a,#0b
	ld hl,l663a
	call #bcbc
	ld a,#0b
	ld hl,l6642
	call #bcbf
	ld a,#0c
	ld hl,l6647
	call #bcbc
	ld a,#0d
	ld hl,l6650
	call #bcbc
	ld a,#0d
	ld hl,l6658
	call #bcbf
	ld a,#01
	ld hl,l6660
	call #bcbc
	ld a,#03
	ld hl,l6668
	call #bcbc
	ld a,#03
	ld hl,l666d
	call #bcbf
	ld a,#04
	ld hl,l6672
	call #bcbc
	ld a,#05
	ld hl,l667a
	call #bcbf
	ld a,#06
	ld hl,l6680
	call #bcbf
	ld a,#07
	ld hl,l6691
	call #bcbf

;	added by Megachur
	jp l8819


;
.game_name
	db "Mata Hari",0
.game_year
	db "1988",0
.game_publisher
	db "Loriciels",0
.music_author
	db "JP Biscay",0
.music_comment
	db "",0

	read "music_end_v1_0.asm"
